<!-- 使用方法, 在进入前设置uniStorage { title, content} -->

<template>
  <view class="text-details-main">
	<view style="margin-top: 35%;"></view>
    <view @click="showVersion" class="body" >{{ '服务 · 专注 · 创新' }}</view>
	<view class="body" >{{ '客服热线: 400-0755-388' }}</view>
	<view style="margin-top: 100%;margin-left: 10%;">
		<!-- <text style="color: #000000;">同意</text> -->
		<text style="color: #d8c31e;" @click="open(0)">《企服云服务协议》</text>
		<text style="color: #000000;">以及</text>
		<text style="color: #d8c31e;" @click="open(1)">《企服云隐私政策》</text>
	</view>
	<view v-if="showFlag" style="margin-left: 45%;">
		<!-- <text style="color: #000000;">同意</text> -->
		<text style="color: #050fd8;">{{ 'v3.3.2' }}</text>
	</view>
  </view>
</template>

<script>
	import {
		ONLINE_SERVER_ADDRESS_BASE
	} from "../../util/network.js"

export default {

  data() {
    return {
      detail: {
        title: '',
        content: '',
      },
	  showFlag: false,
    };
  },
  methods:{
	showVersion(){
		this.showFlag = true
	},
	open(type){
		let _this = this
		uni.request({
			url:`${ONLINE_SERVER_ADDRESS_BASE}/protocol/mobile-show`,
			data:{
				type:type
			},
			method:'GET',
			success: function (res) {
				console.log('协议',res)
				if(res.data.code == 200){
					_this.roleInfo = res.data.data.content
					uni.navigateTo({
						url:'../ruleDisplay/ruleDisplay?url=true' + '&htmlStr=' + encodeURIComponent(_this.roleInfo)
					})
				}
				if(res.data.code == 4000){
					uni.showModal({
						content:'后台管理暂未配置相关资源',
						showCancel:false
					});
				}
			}
		})
	},  
  },
  mounted() {
    // this.detail = uniGetStorageSync(ROUTER_OBJ);
    // console.log(this.detail)
    uni.setNavigationBarTitle({
      title: '关于我们',
    });
  },
};
</script>

<style lang="scss" scoped>
// @import '../assets/styles/global';
.text-details-main {
  // @include center;
  flex-direction: column;
  padding: 32rpx;
  .title {
    width: 100%;
    height: 40rpx;
    font-size: 36rpx;
    line-height: 40rpx;
    color: #06121f;
  }

  .body {
    margin-top: 38rpx;
	align-items: center;
	text-align:center;
    width: 100%;
    font-size: 30rpx;
    color: #06121f;
  }
  .body1 {
    margin-top: 38rpx;
  	align-items: center;
  	text-align:center;
    width: 100%;
    font-size: 28rpx;
    color: #06121f;
  }
}
</style>
